package com.xiaoxie.common.config;

import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Knife4jConfig {
    // quartz 分组
    @Bean
    public GroupedOpenApi quartzApi() {
        return GroupedOpenApi.builder()
                .group("定时任务")
                .pathsToMatch("/job/**")
                .packagesToScan("com.xiaoxie.web.quartz")
                .build();
    }

    // system 分组
    @Bean
    public GroupedOpenApi systemApi() {
        return GroupedOpenApi.builder()
                .group("系统管理")
                .pathsToMatch("/system/**")
                .packagesToScan("com.xiaoxie.web.system")
                .build();
    }

    // report分组
    @Bean
    public GroupedOpenApi reportApi() {
        return GroupedOpenApi.builder()
                .group("报表管理")
                .pathsToMatch("/report/**")
                .packagesToScan("com.xiaoxie.web.report")
                .build();
    }


    // AI分组
    @Bean
    public GroupedOpenApi aiApi() {
        return GroupedOpenApi.builder()
                .group("AI")
                .pathsToMatch("/ai/**")
                .packagesToScan("com.xiaoxie.web.ai")
                .build();
    }
}
